
<legend>
    <h4>
        <?php //echo '加入机构'; ?>
    </h4>
</legend>
<?php if (count($spaceList) < 1) { ?>
    <div class="text-success well"> no space to find for join!</div> 
    <?php return;
} ?>
<fieldset>
    <table class="table table-hover">
        <thead>
            <tr>
                <th>机构名称</th>
                <th>机构说明</th>
                <th>操作</th>
            </tr> 
        </thead>
        <tbody>
            <?php
            foreach ($spaceList as $id => $spaceInfo) {
                if ($spaceInfo instanceof BTreeList) {
                    $spaceData = $spaceInfo->getItemsInArray();
                    $description = isset($spaceData['description']) ? $spaceData['description'] : $spaceData['name'];
                    ?>
                    <tr>
                        <td> <?php echo $spaceData['name']; ?> </td>
                        <td> <?php echo $description; ?> </td>
                        <td>
                            <div class="row-fluid">
                                <?php
                                $spaceControl = Blyn::app()->getActiveSpace()->getUIManager();
                                echo $spaceControl->getAjaxLink('关注机构', array(
                                    'cooker' => 'BSpaceCooker@showJoinSpace',
                                    'spaceId' => $spaceData['spaceId']
                                ));
                                ?>
                            </div>                   
                        </td>
                    </tr>
                    <?php
                }
            }
            ?>
        </tbody>
    </table>
    <div class="pagination">  
        <ul>  
            <li class="active">
                <a href="javascript:void()">前一页</a>    </li>  
            <li class="active">
                <a href="javascript:void()">1</a>    </li>  
            <li class="active">
                <a href="javascript:void()">后一页</a>    </li>  
        </ul>  
    </div>
